package org.example.domain.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TransitionResult {
    // 当前题目总结
    private String currentTopicSummary;
    
    // 下一题目
    private String nextTopic;
    
    // 过渡消息
    private String transitionMessage;
    
    // 当前题目评估结果
    private QuestionResult questionResult;
    
    // 是否为最后一题
    private boolean isLastQuestion;
    
    /**
     * 获取格式化的过渡消息
     */
    public String getTransitionMessage() {
        if (transitionMessage != null && !transitionMessage.isEmpty()) {
            return transitionMessage;
        }
        
        // 如果没有指定过渡消息，生成默认消息
        StringBuilder message = new StringBuilder();
        
        // 添加当前题目总结
        if (currentTopicSummary != null && !currentTopicSummary.isEmpty()) {
            message.append(currentTopicSummary).append("\n\n");
        }
        
        // 添加过渡提示
        if (isLastQuestion) {
            message.append("面试所有问题已完成，感谢您的参与！");
        } else {
            message.append("让我们继续下一个问题：").append(nextTopic);
        }
        
        return message.toString();
    }
}